package com.upay.android.domain.user;

import com.upay.android.util.StringUtils;

public class UserWrapper {
	
	/* ---- Constants ---- */
	private static final String SPACE = " ";

	/* ---- Business Methods ---- */
	
	public static String getFullName(User user) {
		StringBuilder fullName = new StringBuilder();
		if (StringUtils.hasText(user.getFirstName())) {
			fullName.append(user.getFirstName().trim());
		}
		if (StringUtils.hasText(user.getLastName()) && StringUtils.hasText(user.getLastName())) {
			fullName.append(SPACE);
		}
		if (StringUtils.hasText(user.getLastName())) {
			fullName.append(user.getLastName().trim());			
		}
		return fullName.toString();
	}

}
